home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / SourceCode / OOP_Course / Examples / ExtendDraw / Ellipse.bproj / Ellipse.m < prev    next >
Text File  |  1992-12-19  |  487b  |  34 lines

  1.  
  2. #import <appkit/appkit.h>
  3. #import "Ellipse.h"
  4.  
  5. @implementation Ellipse:AShape
  6.  
  7. -drawShape
  8. {
  9.     float rx,ry,cx,cy;
  10.     
  11.     rx = bbox.size.width/2.0;
  12.     ry = bbox.size.height/2.0;
  13.     cx = bbox.origin.x+rx;
  14.     cy = bbox.origin.y+ry;
  15.     
  16.     PSgsave();
  17.     PSsetlinewidth(0.0);
  18.     PStranslate(cx,cy);
  19.     PSscale(rx,ry);
  20.     PSnewpath();
  21.         PSarc(0.,0.,1.,0.,360.);
  22.     PSclosepath();
  23.     PSsetgray(shade);
  24.     if(fill)
  25.         PSfill();
  26.     else
  27.         PSstroke();
  28.     PSgrestore();
  29.     return self;
  30. }
  31.  
  32.  
  33. @end
  34.